/*!
 * Ext JS Library 3.0.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 *
Ext.onReady(function(){

    Ext.QuickTips.init();

    // turn on validation errors beside the field globally
    Ext.form.Field.prototype.msgTarget = 'side';

    var bd = Ext.getBody();
*/
 
    var logueo = new Ext.FormPanel({
        labelWidth: 75, // label settings here cascade unless overridden
        url:MyURL+'usuario/login',
	//region:'center',
        frame:true,
        title: 'Ingresar',
        bodyStyle:'padding:5px 5px 0',
        width: 388,
       // defaults: {width: 230},
        defaultType: 'textfield',
	region:'north',

        items: [{
                fieldLabel: 'Login',
                name: 'signin[login]',
                allowBlank:false
		},
		{
		    inputType: 'password',
		    fieldLabel: 'Contrase&ntilde;a',
		    name: 'signin[pass]',
		    id: 'pass'
		}

        ],

        buttons: [{
            text: 'Ingresar',
            handler: function(){
                logueo.getForm().submit({
                    success: function(a,b){
                         window.location=MyURL+"gestionUsuario"
                    },
                    failure: function(f,a){

                        Ext.Msg.alert('Error', 'El Usuario y/o el password son incorrectos');
                    }
                });
            }
        },{
            text: 'Registrar'
        }]
    });

  //  simple.render(document.body);

//});